<!DOCTYPE html><html class=split lang=en-US-x-hixie><script src=../link-fixup.js defer=""></script>
<!-- Mirrored from html.spec.whatwg.org/dev/xhtml.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 10 Sep 2025 08:36:28 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<meta charset=utf-8><meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name=viewport><title>HTML Standard, Edition for Web Developers</title><meta content=#3c790a name=theme-color><meta content="light dark" name=color-scheme><link rel=stylesheet href=../../resources.whatwg.org/standard-shared-with-dev.css crossorigin=""><link rel=icon href=https://resources.whatwg.org/logo.svg crossorigin=""><link rel=stylesheet href=styles.css crossorigin=""><script>
   function toggleStatus(div) {
     div.parentNode.classList.toggle('wrapped');
   }
   function setLinkFragment(link) {
     link.hash = location.hash;
   }
  </script><body>
  <script async="" src=search.js></script>
  
  
  <header id=head class="head with-buttons">
   <a href=https://whatwg.org/ class=logo><img width=100 alt=WHATWG crossorigin="" class=darkmode-aware src=https://resources.whatwg.org/logo.svg height=100></a>
   
   <hgroup><h1><a rel=home href=index.html>HTML: The Living Standard</a></h1><p id=dev-edition-h2>Edition for Web Developers — Last Updated <span class=pubdate>10 September 2025</span></hgroup>
   

   <div id=search>
    <input placeholder="Search. Press '/'" autocomplete=off name=query id=query type=search>
    <ol id=results></ol>
   </div>
  </header>

  

  

  

  
  

  
  

  

  <nav><a href=named-characters.html>← 13.2 Named character references</a> — <a href=index.html>Table of Contents</a> — <a href=obsolete.html>15 Obsolete features →</a></nav><ol class=toc><li><a href=xhtml.html#the-xhtml-syntax><span class=secno>14</span> The XML syntax</a></ol><h2 id=the-xhtml-syntax><span class=secno>14</span> <dfn id=xhtml>The XML syntax</dfn><a href=#the-xhtml-syntax class=self-link></a></h2><div class="mdn-anno wrapped"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/XHTML title="XHTML is a term that was historically used to describe HTML documents written to conform with XML syntax rules.">HTML/XHTML</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>2+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>4+</span></span><hr><span class="opera yes"><span>Opera</span><span>9+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android yes"><span>Firefox Android</span><span>4+</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>2+</span></span><span class="chrome_android yes"><span>Chrome Android</span><span>18+</span></span><span class="webview_android yes"><span>WebView Android</span><span>2+</span></span><span class="samsunginternet_android yes"><span>Samsung Internet</span><span>1.0+</span></span><span class="opera_android yes"><span>Opera Android</span><span>10.1+</span></span></div></div></div>

  <p class=note>This section only describes the rules for XML resources. Rules for
  <code>text/html</code> resources are discussed in the section above entitled "<a id=the-xhtml-syntax:syntax href=syntax.html#syntax>The HTML
  syntax</a>".</p>

  <p id=xml-syntax-not-recommended class=warning>Using the XML syntax is not recommended, for
  reasons which include the fact that there is no specification which defines the rules for how an
  XML parser must map a string of bytes or characters into a <code>Document</code> object, as well
  as the fact that the XML syntax is essentially unmaintained — in that, it’s not expected that any
  further features will ever be added to the XML syntax (even when such features have been added to
  the <a href=syntax.html#syntax id=the-xhtml-syntax:syntax-2>HTML syntax</a>).</p>

  

  <p class=note>The XML syntax for HTML was formerly referred to as "XHTML", but this
  specification does not use that term (among other reasons, because no such term is used for the
  HTML syntaxes of MathML and SVG).</p>

  <p>The syntax for XML is defined in <cite>XML</cite> and <cite>Namespaces in XML</cite>. <a href=references.html#refsXML>[XML]</a>
  <a href=references.html#refsXMLNS>[XMLNS]</a></p>

  <p>This specification does not define any syntax-level requirements beyond those defined for XML
  proper.</p>

  <p>XML documents may contain a <code>DOCTYPE</code> if desired, but this is not required
  to conform to this specification. This specification does not define a public or system
  identifier, nor provide a formal DTD.</p>

  <p class=note>According to <cite>XML</cite>, XML processors are not guaranteed to process
  the external DTD subset referenced in the DOCTYPE. This means, for example, that using <a href=https://www.w3.org/TR/xml/#dt-entref>entity references</a> for characters in XML documents
  is unsafe if they are defined in an external file (except for <code>&amp;lt;</code>,
  <code>&amp;gt;</code>, <code>&amp;amp;</code>,
  <code>&amp;quot;</code>, and <code>&amp;apos;</code>).</p>


  



  


  


  


  


  


  

  

  


  


  


  


  


  


  


  


  


  


  

  <p>The following styles are expected to apply to <code id=the-xhtml-syntax:the-select-element><a href=form-elements.html#the-select-element>select</a></code> elements when they are being
  rendered as a <span>drop-down box</span> with <a id=the-xhtml-syntax:base-appearance href=https://drafts.csswg.org/css-ui/#base-appearance data-x-internal=base-appearance>base appearance</a>:</p>

  <pre><code class='css'><c- n>@namespace</c-> <c- s>&quot;http://www.w3.org/1999/xhtml&quot;</c-><c- p>;</c->

<c- f>select </c-><c- p>{</c->
  <c- k>text-transform</c-><c- p>:</c-> initial<c- p>;</c->
  <c- k>text-align</c-><c- p>:</c-> initial<c- p>;</c->
  <c- k>text-indent</c-><c- p>:</c-> initial<c- p>;</c->
  <c- k>background-color</c-><c- p>:</c-> transparent<c- p>;</c->
  <c- k>border</c-><c- p>:</c-> <c- m>1</c-><c- l>px</c-> solid currentColor<c- p>;</c->
  <c- k>padding-block</c-><c- p>:</c-> <c- m>0.25</c-><c- l>em</c-><c- p>;</c->
  <c- k>padding-inline</c-><c- p>:</c-> <c- m>0.5</c-><c- l>em</c-><c- p>;</c->
  <c- k>min-block-size</c-><c- p>:</c-> <c- nf>calc-size</c-><c- p>(</c->auto<c- p>,</c-> <c- nf>max</c-><c- p>(</c->size<c- p>,</c-> <c- m>24</c-><c- l>px</c-><c- p>,</c-> <c- m>1</c-><c- l>lh</c-><c- p>));</c->
  <c- k>min-inline-size</c-><c- p>:</c-> <c- nf>calc-size</c-><c- p>(</c->auto<c- p>,</c-> <c- nf>max</c-><c- p>(</c->size<c- p>,</c-> <c- m>24</c-><c- l>px</c-><c- p>));</c->
  <c- k>display</c-><c- p>:</c-> inline-flex<c- p>;</c->
  <c- k>gap</c-><c- p>:</c-> <c- m>0.5</c-><c- l>em</c-><c- p>;</c->
  <c- k>border-radius</c-><c- p>:</c-> <c- m>0.5</c-><c- l>em</c-><c- p>;</c->
  <c- k>user-select</c-><c- p>:</c-> none<c- p>;</c->
  <c- k>box-sizing</c-><c- p>:</c-> border-box<c- p>;</c->
  <c- k>field-sizing</c-><c- p>:</c-> content !important;
}

select &gt; button:first-child {
  all: unset;
  display: contents;
}

select:enabled:hover,
select option:enabled:hover {
  background-color: color-mix(in lab, currentColor 10%, transparent);
}
select:enabled:active,
select option:enabled:active {
  background-color: color-mix(in lab, currentColor 20%, transparent);
}
select:disabled,
select option:disabled {
  color: color-mix(in lab, currentColor 50%, transparent);
}

::picker(select) {
  box-sizing: border-box;
  border: 1px solid;
  padding: 0;
  color: CanvasText;
  background-color: Canvas;
  margin: 0;
  inset: auto;
  min-inline-size: anchor-size(self-inline);
  max-block-size: stretch;
  overflow: auto;
  position-area: block-end span-inline-end;
  position-try-order: most-block-size;
  position-try-fallbacks:
    block-start span-inline-end,
    block-end span-inline-start,
    block-start span-inline-start;
}

select option {
  min-inline-size: 24px;
  min-block-size: max(24px, 1lh);
  padding-inline: 0.5em;
  padding-block-end: 0;
  display: flex;
  align-items: center;
  gap: 0.5em;
  white-space: nowrap;
}

select option::checkmark {
  content: &apos;\2713&apos; / &apos;&apos;;
}
select option:not(:checked)::checkmark {
  visibility: hidden;
}

select::picker-icon {
  content: counter(fake-counter-name, disclosure-open);
  display: block;
  margin-inline-start: auto;
}

select optgroup {
  font-weight: bolder;
}

select optgroup option {
  font-weight: normal;
}

select optgroup legend {
  padding-inline: 0.5em;
  min-block-size: 1lh;
}</code></pre>

  



  


  




  <nav><a href=named-characters.html>← 13.2 Named character references</a> — <a href=index.html>Table of Contents</a> — <a href=obsolete.html>15 Obsolete features →</a></nav>
